
			//绑定vue
			var newapp = new Vue({
				el: ".popup-addTopic",
				data: {
					imgs: []
				},
				methods: {
					/* 头像 */
					imgSrc: function(src) {
						return src;
					},
					/* 添加照片 */
					addImgMethod: function() {
						var path=$("#addImg").val();
						if(path!=null&&path!=""){
							var that = this;
							$.ajax({
								url: serviceIP+"/forum/addImg",
								type: "post",
								dataType: "json",
								cache: false,
								data: new FormData($("#imgForm")[0]),
								headers: {
											"token":token,
											"refreshtoken":refreshtoken
										},
								processData: false, // 不处理数据
								contentType: false, // 不设置内容类型
								success: function(data) {
									that.imgs.unshift(data.url);
								}
							});
						}
					},
					/* 发送话题 */
					addTopic: function() {
						var text = $("#topicContent").val();
						if (text.length < 5) {
							$.toast("内容太短了！");
						} else {
							var userImgs = this.imgs;
							var that = this;
							$.ajax({
								type: 'get',
								url: serviceIP+"/forum/addTopic",
								dataType: 'json',
									data:{
										content: text,
										imgs: userImgs,
										forumId: "myForum"
									},
								headers: {
										"token":token,
										"refreshtoken":refreshtoken
									},
								success:function (data) {
									if (data != 0) {
										if(data == 1){
											$.toast("已发布，经验+15");
										}else if(data == 2){
											$.toast("已发布");
										}else{
											$.toast("失败，尚未认证社区");
										}
										$("#topicContent").val("");
										that.imgs = [];
										//重新加载
										/* find = "";
										lastIndex = 1;
										$('.infinite-scroll .list-container').html("");
										$.attachInfiniteScroll($('.infinite-scroll'));
										aja(); */
										//关闭弹窗
										$.closeModal('.popup-addTopic');
									} else {
										$.toast("失败，系统维护中");
									}
								}});
						}
					},
					//图片删除
					delImg: function(index) {
						this.imgs.splice(index, 1);
					}
				}
			});